//
//  MZY_WithoutPicture.m
//  FullHouse
//
//  Created by dllo on 16/1/25.
//  Copyright © 2016年 yy. All rights reserved.
//

#import "MZY_WithoutPicture.h"

#define WIDTH self.contentView.frame.size.width
#define HEIGHT self.contentView.frame.size.height

@implementation MZY_WithoutPicture

- (void)dealloc
{
    [self.backView release];
    [self.authorImageView release];
    [self.titleLabel release];
    [self.locationLabel release];
    [self.starMarkView release];
    [self.markLabel release];
    [self.commentLabel release];
    [self.oneStarImageView release];
    [self.twoStarImageView release];
    [self.threeStarImageView release];
    [self.fourStarImageView release];
    [self.fiveStarImageView release];
    [self.worksLabel release];
    [self.appointmentLabel release];
    [super dealloc];
}

- (id)initWithStyle:(UITableViewCellStyle)style reuseIdentifier:(NSString *)reuseIdentifier{
    self = [super initWithStyle:style reuseIdentifier:reuseIdentifier];
    if (self) {
        [self createView];
    }
    return self;
}

- (void)createView{
    
    self.contentView.backgroundColor = [UIColor cyanColor];
    
    self.backView = [[UIView alloc]init];
    self.backView.backgroundColor = [UIColor whiteColor];
    [self.contentView addSubview:self.backView];
    [self.backView release];
    
    self.authorImageView = [[UIImageView alloc]init];
    [self.contentView addSubview:self.authorImageView];
    [self.authorImageView release];
    
    self.titleLabel = [[UILabel alloc]init];
    [self.contentView addSubview:self.titleLabel];
    [self.titleLabel release];
    
    self.locationLabel = [[UILabel alloc]init];
    [self.contentView addSubview:self.locationLabel];
    [self.locationLabel release];
    
    self.starMarkView = [[UIView alloc]init];
    //    self.starMarkView.backgroundColor = [UIColor blueColor];
    [self.contentView addSubview:self.starMarkView];
    [self.starMarkView release];
    
    self.markLabel = [[UILabel alloc]init];
    //    self.markLabel.backgroundColor = [UIColor lightGrayColor];
    [self.starMarkView addSubview:self.markLabel];
    [self.markLabel release];
    
    self.oneStarImageView = [[UIImageView alloc]init];
    //    self.oneStarImageView.backgroundColor = [UIColor yellowColor];
    [self.starMarkView addSubview:self.oneStarImageView];
    [self.oneStarImageView release];
    
    self.twoStarImageView = [[UIImageView alloc]init];
    //    self.twoStarImageView.backgroundColor = [UIColor greenColor];
    [self.starMarkView addSubview:self.twoStarImageView];
    [self.twoStarImageView release];
    
    self.threeStarImageView = [[UIImageView alloc]init];
    //    self.threeStarImageView.backgroundColor = [UIColor redColor];
    [self.starMarkView addSubview:self.threeStarImageView];
    [self.threeStarImageView release];
    
    self.fourStarImageView = [[UIImageView alloc]init];
    //    self.fourStarImageView.backgroundColor = [UIColor purpleColor];
    [self.starMarkView addSubview:self.fourStarImageView];
    [self.fourStarImageView release];
    
    self.fiveStarImageView = [[UIImageView alloc]init];
    //    self.fiveStarImageView.backgroundColor = [UIColor brownColor];
    [self.starMarkView addSubview:self.fiveStarImageView];
    [self.fiveStarImageView release];
    
    self.commentLabel = [[UILabel alloc]init];
    //    self.commentLabel.backgroundColor = [UIColor orangeColor];
    [self.contentView addSubview:self.commentLabel];
    [self.commentLabel release];
    
    self.worksLabel = [[UILabel alloc]init];
    [self.contentView addSubview:self.worksLabel];
    [self.worksLabel release];
    
    self.textField = [[UITextField alloc]init];
    self.textField.backgroundColor = [UIColor lightGrayColor];
    [self.contentView addSubview:self.textField];
    [self.textField release];
    
    self.appointmentLabel = [[UILabel alloc]init];
    [self.contentView addSubview:self.appointmentLabel];
    [self.appointmentLabel release];
}

- (void)layoutSubviews{
    [super layoutSubviews];
    self.backView.frame = CGRectMake(0, 0, WIDTH, HEIGHT - 10);
    self.authorImageView.frame = CGRectMake(10, 10, 50, 50);
    self.titleLabel.frame = CGRectMake(70, 10, 100, 20);
    self.locationLabel.frame = CGRectMake(70, 40, 100, 20);
    self.starMarkView.frame = CGRectMake(WIDTH - 150, 15, 140, 20);
    self.oneStarImageView.frame = CGRectMake(0, 0, 20, 20);
    self.twoStarImageView.frame = CGRectMake(20, 0, 20, 20);
    self.threeStarImageView.frame = CGRectMake(40, 0, 20, 20);
    self.fourStarImageView.frame = CGRectMake(60, 0, 20, 20);
    self.fiveStarImageView.frame = CGRectMake(80, 0, 20, 20);
    self.markLabel.frame = CGRectMake(100, 0, 40, 20);
    self.commentLabel.frame = CGRectMake(WIDTH - 150, 40, 80, 20);
    self.worksLabel.frame = CGRectMake((WIDTH - 35) / 4 - 45, 70, 140, 30);
    self.textField.frame = CGRectMake(WIDTH / 2, 70, 1, 30);
    self.appointmentLabel.frame = CGRectMake((WIDTH - 35) / 4 * 2 + 30, 70, 120, 30);
}

@end
